const express = require('express')

const app = express()

//get post请求
app.get('/user', (req, res) => {

    res.send({ name: 'zs', age: 20, gender: '男' })
})

app.post('/user', (req, res) => {

    res.send("请求成功")
});

app.get('/', (req, res) => {
    console.log(req.query)
    res.send(req.query)
})

app.get('/user/:id/:name', (req, res) => {
    console.log(req.params)
    res.send(req.params )
})

app.listen(8080, () => {
    console.log('express,at http://127.0.0.1')
})
